﻿<ui:OptionPanel xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                xmlns:ui="clr-namespace:ICSharpCode.SharpDevelop.Gui;assembly=ICSharpCode.SharpDevelop" 
                xmlns:widgets="http://icsharpcode.net/sharpdevelop/widgets" 
                xmlns:sd="http://icsharpcode.net/sharpdevelop/core" 
                xmlns:local="clr-namespace:HexEditor.Util" 
                x:Class="HexEditor.View.HexEditOptionsPanel">
	<StackPanel Orientation="Vertical">
		<GroupBox Header="{sd:Localize AddIns.HexEditor.Display}">
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition Height="*" />
					<RowDefinition Height="*" />
					<RowDefinition Height="*" />
					<RowDefinition Height="*" />
					<RowDefinition Height="*" />
					<RowDefinition Height="*" />
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="2*" />
					<ColumnDefinition Width="2*" />
					<ColumnDefinition Width="3*" />
				</Grid.ColumnDefinitions>
				<CheckBox Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Margin="0,5,0,0"
				          Content="{sd:Localize AddIns.HexEditor.SizeToFit}"
				          IsChecked="{sd:OptionBinding local:Settings.FitToWidth}" />
				<Label Grid.Column="0" Grid.Row="2" Margin="0,5,0,0"
				       Content="{sd:StringParse ${res:AddIns.HexEditor.DefaultBytesPerLine}:}" />
				<Label Grid.Column="0" Grid.Row="1" Margin="0,5,0,0"
				       Content="{sd:StringParse ${res:AddIns.HexEditor.NumeralSystem}:}" />
				<widgets:NumericUpDown x:Name="bytesPerLine" Grid.Column="1" Grid.Row="1"
					Margin="0,5,0,0" Minimum="1" />
				<ComboBox x:Name="viewModes" Grid.Column="1" Grid.Row="2" Margin="0,5,0,0"
				          SelectedValue="{sd:OptionBinding local:Settings.ViewMode}"
				          SelectedValuePath="Value" DisplayMemberPath="Text" />
				<Label Grid.Column="0" Grid.Row="3" Margin="0,5,0,0"
				       Content="{sd:StringParse ${res:AddIns.HexEditor.Display.Elements.Offset}:}" />
				<ui:ColorPickerButton x:Name="offsetColorPicker" Grid.Column="1" Grid.Row="3" Margin="0,5,0,0"
				                Value="{sd:OptionBinding local:Settings.OffsetForeColor}" />
				<Button Grid.Column="2" Grid.Row="3" Margin="5,5,0,0"
				        x:Name="offsetFontButton" Click="FontChooserClick" />
				<Label Grid.Column="0" Grid.Row="4" Margin="0,5,0,0"
				       Content="{sd:StringParse ${res:AddIns.HexEditor.Display.Elements.Data}:}" />
				<ui:ColorPickerButton x:Name="dataColorPicker" Grid.Column="1" Grid.Row="4" Margin="0,5,0,0"
				                Value="{sd:OptionBinding local:Settings.DataForeColor}" />
				<Button Grid.Column="2" Grid.Row="4" Margin="5,5,0,0"
				        x:Name="dataFontButton" Click="FontChooserClick" />
				<GroupBox Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Header="{sd:Localize Global.Preview}">
					<StackPanel HorizontalAlignment="Center">
						<TextBlock x:Name="offsetPreview" Text="{sd:Localize AddIns.HexEditor.Display.Elements.Offset}">
							<TextBlock.Foreground>
								<SolidColorBrush Color="{Binding Value, ElementName=offsetColorPicker}" />
							</TextBlock.Foreground>
						</TextBlock>
						<TextBlock x:Name="dataPreview" Text="{sd:Localize AddIns.HexEditor.Display.Elements.Data}">
							<TextBlock.Foreground>
								<SolidColorBrush Color="{Binding Value, ElementName=dataColorPicker}" />
							</TextBlock.Foreground>
						</TextBlock>
					</StackPanel>
				</GroupBox>
			</Grid>
		</GroupBox>
	</StackPanel>
</ui:OptionPanel>